]> git.r.bdr.sh - rbdr/captura/blame - Captura/Core Extensions/NSScreen+screenWithMouse.swift
Add sparkle
[rbdr/captura] / Captura / Core Extensions / NSScreen+screenWithMouse.swift
CommitLineData
7ee43fb8
RBR
1import Cocoa
2
3extension NSScreen {
4 static var screenWithMouse: NSScreen? {
5 let mouseLocation = NSEvent.mouseLocation
6 for screen in NSScreen.screens {
7 if NSMouseInRect(mouseLocation, screen.frame, false) {
8 return screen
9 }
10 }
11 return NSScreen.main
12 }
13}